package com.itheima;

import java.util.ArrayList;
import java.util.stream.Stream;

public class Test02 {
    public static void main(String[] args) {
        ArrayList<String> man = new ArrayList<>();
        man.add("张国立");
        man.add("张晋");
        man.add("刘烨");
        man.add("郑伊健");
        man.add("徐峥");
        man.add("王宝强");

        ArrayList<String> woman = new ArrayList<>();
        woman.add("郑爽");
        woman.add("杨紫");
        woman.add("关晓彤");
        woman.add("张天爱");
        woman.add("杨幂");
        woman.add("赵丽颖");

        Stream<String> limit = man.stream().filter(s -> s.length() == 3).limit(2);
        Stream<String> skip = woman.stream().filter(s -> s.startsWith("杨")).skip(1);

        Stream<String> a = Stream.concat(limit, skip);
        a.forEach(s-> System.out.println(s));
    }
}
